<%@ page language="java" contentType="text/html" pageEncoding="utf-8"%>
<%@include file="/WEB-INF/pages/common/common.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="/WEB-INF/pages/common/head.jsp"%>
<script type="text/javascript">
	var iconData;
	//message是父页面传过来的参数，在父页面显示信息
	function manageForm(message){
		var isV =$("#tableForm").form("validate");
		if(!isV) return;
		//显示加载进度条
	    imonJYRH.showZone();
	    $.ajax({
			url : imonJYRH.url('${path}/sys/function/ajaxModify.do'),
			data : $("#tableForm *").serializeArray(),
			success : function(reMsg) {
				if(reMsg.success){
					var node = reMsg.obj;
	                parent.returnResult(node,false);
	            }
	            message.show({ msg : reMsg.msg, title : '提示',showType:'slide'});
			    imonJYRH.hideZone();
			}
		});
	}

	$(function(){  
	    // 上级菜单
		$('#menuCode').combotree({
			url:  imonJYRH.url('${path}/sys/function/ajaxTreeGrid.do'),
			lines : true,
		    hasDownArrow:true,editable:false
		}); 
		 iconData = [ 
		         	{value : '',text : '默认'}, 
		          	{value : 'icon-add',text : 'icon-add'}, 
		          	{value : 'icon-edit',text : 'icon-edit'}, 
		          	{value : 'icon-remove',text : 'icon-remove'}, 
		          	{value : 'icon-save',text : 'icon-save'}, 
		          	{value : 'icon-cut',text : 'icon-cut'}, 
		          	{value : 'icon-ok',text : 'icon-ok'}, 
		          	{value : 'icon-no',text : 'icon-no'}, 
		          	{value : 'icon-cancel',text : 'icon-cancel'}, 
		          	{value : 'icon-reload',text : 'icon-reload'}, 
		          	{value : 'icon-search',text : 'icon-search'}, 
		          	{value : 'icon-print',text : 'icon-print'}, 
		          	{value : 'icon-help',text : 'icon-help'}, 
		          	{value : 'icon-undo',text : 'icon-undo'}, 
		          	{value : 'icon-redo',text : 'icon-redo'}, 
		          	{value : 'icon-back',text : 'icon-back'}, 
		          	{value : 'icon-sum',text : 'icon-sum'}, 
		          	{value : 'icon-tip',text : 'icon-tip'}
		         ];
	
		// 菜单图标
         $('#iconCode').combobox({
        	data:iconData,
			formatter : function(v) {
				return imonJYRH.fs('<span class="{0}" style="display:inline-block;vertical-align:middle;width:16px;height:16px;"></span>{1}', v.value, v.value);
			}
		});	
      });  
</script>
</head>
<body class="bodyForm">
	<form method="post">
		<table class="tableForm" id="tableForm" width="100%">
			<tr>
				<td align="right">菜单名称:</td>
				<td align="left">
					<input name="id" value="${function.id }" type="hidden">
					<input name="code" value="${function.code }" type="hidden">
					<input id="menuName" type="text" maxlength="200"  class="easyui-validatebox" name="text" value="${function.text}"
					data-options="required:true">
				</td>
				<td align="right">排序:</td>
				<td align="left">
					<input class="easyui-numberspinner" data-options="min:0,max:20" name="rowNo" style="width: 150px" ></input>
				</td>
			</tr>
			<tr>
				<td align="right">上级菜单:</td>
				<td align="left">
					<input id="menuCode" name="parentCode" style="width: 150px" value="${function.parentCode }" />
				</td>
				<td align="right">菜单图标:</td>
				<td align="left">
					<input id="iconCode" style="width: 150px" name="icon" value="${function.icon }" />
				</td>
			</tr>
			<tr>
				<td align="right">菜单地址:</td>
				<td align="left" colspan="3">
					<textarea id="roleDesc" rows="3" cols="46" name="url">${function.url }</textarea>
				</td>
			</tr>
		</table>
	</form>
</body>
</html>